<div class="v3-mod no-bor">
    <div class="inner">
        <div class="hd">
            <h4 class="gname" style="font-size: 14px;font-weight: 700;
line-height: 24px;"> {$groupname}</h4>
            <div style="float: right;margin-top: -20px;margin-right: 50px;">
            <if condition="$groupid gt 0 ">
                <div onclick="del_gname('{$groupid}')" class="creat_group_btn" > 删除分组</div>
            </if>
            </div>
        </div>


        <div class="bd">
            <ul class=" js_left_list" id="group_list" style="margin-top: 20px;">
                <volist name="user1['data']" id="vo">
                    <div class="" style="height: 60px;">
                        <div style="float: left">
                            <div style="float: left">
                                <img src=" {$vo.avatar_small}">
                            </div>
                            <div style="float: left; margin-left: 20px;margin-top: 10px;">
                                {$vo.friend_info.0.name}
                            </div>
                        </div>
                        <div style="float: right;margin-right: 50px;margin-top: 10px;">
                            <div style="margin-left: 100px;"><a class="a" onclick="delfriend('{$vo.uid}','{$groupid}')">解除好友关系</a></div>
                            <div id="" style="margin-top: -12px;">
                                <a id="gname{$vo.uid}" class="a gname" onmousemove="Block('{$vo.uid}')"
                                   onmouseout="hide('{$vo.uid}')">
                                    {$vo.groupname}
                                </a>
                            </div>
                            <div id="{$vo.uid}" style="display: none;" onmousemove="Block('{$vo.uid}')"
                                 onmouseout="hide('{$vo.uid}')">
                                <div><a class="a" onclick="changegroup('{$vo.uid}',0)">未分组</a></div>
                                <volist name="group" id="v">
                                    <div><a class="a" onclick="changegroup('{$vo.uid}','{$v.id}')">{$v.groupname}</a>
                                    </div>

                                </volist>

                            </div>


                        </div>
                    </div>
                    <div class="solid"></div>
                </volist>
                <div>{$user1.html}</div>
            </ul>
        </div>


    </div>
</div>


<script>
    function changegroup(fid,groupid) {
        $.post(U("friend/Index/changegroup"), { fid: fid ,groupid:groupid}, function (data) {
            if(data.status == 1){
                ui.success('移动分组成功！')
            }
            $('#grouplist').load(U("friend/Index/_grouplist"));
            $('#gname'+data.data.fid).html(data.data.groupname);

        }, 'json');
    }
    function Block(uid) {
        document.getElementById(uid).style.display = " block";
    }
    function hide(uid) {
        document.getElementById(uid).style.display = " none";
    }
    function del_gname(groupid) {
        $.post(U("friend/Index/delgroup"), { groupid: groupid}, function (data) {
            if(data.status == 1){
                ui.success('删除分组成功！')
            }
            location.reload()
        }, 'json');
    }

    function delfriend(fid,groupid) {
        $.post(U("friend/Index/delfriend"), { fid: fid}, function (data) {
            if(data.status == 1){
                ui.success('删除好友成功！')
            }
            $('#friendlist').load(U("friend/Index/_friendlist" + '&groupid=' + groupid));
            $('#grouplist').load(U("friend/Index/_grouplist"));
            $('#distribution').load(U("friend/Index/_distribution"));
        }, 'json');
    }


</script>
